import 'package:asperm/tools/const.dart';
import 'package:asperm/views/custom_cell.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../views/myDialog.dart';


class TipsPage extends StatefulWidget {
  const TipsPage({super.key});

  @override
  State<TipsPage> createState() => _TipsPageState();
}

class _TipsPageState extends State<TipsPage> {

  @override
  void initState() {
    super.initState();

  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Color(0xffF9F9F9),
        appBar: AppBar(
          centerTitle: true,
          title: Text(
            'Tips',
            style: TextStyle(fontSize: 18.sp,fontWeight: FontWeight.w600,color: Color(0xff1B1B1B),),
          ),
          backgroundColor: Colors.white,
          elevation: 0.0,
        ),
        body: Container(
          margin: EdgeInsets.only(left: 0.w,right: 0.w,top: 0.h),
          height: screenHeight(context),
          child: contentWidget(context),
        )
    );
  }

  contentWidget(BuildContext context) {
    return Scrollbar(
       // 可选参数：设置滚动条厚度
        thickness: 6,
        // 可选参数：设置滚动条半径
        radius: const Radius.circular(3),
        // 可选参数：是否总是显示滚动条（默认只在滚动时显示）
        // isAlwaysShown: true,
        // 可选参数：滚动条交互性（默认可以拖动）
        interactive: true,
        child: SingleChildScrollView(
          child: Container(
            margin: EdgeInsets.only(left: 20.w,right: 20.w,top: 20.w),
            child: Column(
              children: [
                Text(
                  '1. When using the quantitative pipette, please avoid squeezing the bulb too forcefully. It is recommended to gently squeeze the bulb to ensure stable liquid aspiration.',
                  style: TextStyle(
                    color: Colors.black,
                    fontWeight: FontWeight.w400,
                    fontSize: textSize_default.sp,
                    height: 1.5,
                  ),
                ),
                SizedBox(height: 20.h,),
                Image.asset('images/tips_1.png',width: screenWidth(context) - 40.w),
                SizedBox(height: 20.h,),
                Text(
                  '2. When aspirating semen, the quantitative pipette only needs to squeeze the bulb once. Do not press the bulb repeatedly. This ensures the accuracy of the liquid volume and avoids affecting the test results.',
                  style: TextStyle(
                    color: Colors.black,
                    fontWeight: FontWeight.w400,
                    fontSize: textSize_default.sp,
                    height: 1.5,
                  ),
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Image.asset('images/tips_2.png',width: ((screenWidth(context) - 40.w) - 20.w)/2,),
                    Image.asset('images/tips_3.png',width: ((screenWidth(context) - 40.w) - 20.w)/2,),
                  ],
                ),
                SizedBox(height: 20.h,),
                Text(
                  '3. When using the sample cup, please handle it carefully to avoid knocking it over. Make sure the sample cup is placed steadily to prevent sample leakage or contamination.',
                  style: TextStyle(
                    color: Colors.black,
                    fontWeight: FontWeight.w400,
                    fontSize: textSize_default.sp,
                    height: 1.5,
                  ),
                ),
                SizedBox(height: 20.h,),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Image.asset('images/tips_4.png',width: ((screenWidth(context) - 40.w) - 20.w)/2,),
                    Image.asset('images/tips_5.png',width: ((screenWidth(context) - 40.w) - 20.w)/2,),
                  ],
                ),
                SizedBox(height: 20.h,),
                Text(
                  '4. After adding the enzyme to the sample cup, please gently shake the cup to ensure the enzyme dissolves completely and mixes thoroughly. This ensures the enzyme is evenly distributed in the sample, guaranteeing accurate test results.',
                  style: TextStyle(
                    color: Colors.black,
                    fontWeight: FontWeight.w400,
                    fontSize: textSize_default.sp,
                    height: 1.5,
                  ),
                ),
                SizedBox(height: 20.h,),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Image.asset('images/tips_6.png',width: ((screenWidth(context) - 40.w) - 20.w)/2,),
                    Image.asset('images/tips_5.png',width: ((screenWidth(context) - 40.w) - 20.w)/2,),
                  ],
                ),
                SizedBox(height: 20.h,),
                Text(
                  '5. When inserting the test card, please follow the direction indicated by the instrument strictly. Make sure the test card is fully inserted to avoid detection failure caused by improper insertion.',
                  style: TextStyle(
                    color: Colors.black,
                    fontWeight: FontWeight.w400,
                    fontSize: textSize_default.sp,
                    height: 1.5,
                  ),
                ),
                SizedBox(height: 20.h,),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Image.asset('images/tips_7.png',width: ((screenWidth(context) - 40.w) - 20.w)/2,),
                    Image.asset('images/tips_8.png',width: ((screenWidth(context) - 40.w) - 20.w)/2,),
                  ],
                ),
                SizedBox(height: 20.h,),
                Text(
                  '6. The light indicators on the instrument show different statuses, with the specific meanings as follows:\nStandby: Blue light steady\nConnected: Blue light flashing\nTesting: Green light flashing\nTest complete: Green light steady\nAbnormal: Red light flashing',
                  style: TextStyle(
                    color: Colors.black,
                    fontWeight: FontWeight.w400,
                    fontSize: textSize_default.sp,
                    height: 1.5,
                  ),
                ),
                SizedBox(height: 20.h,),
                Text(
                  '7. After use, please dispose of the sample cup, test card, and quantitative pipette properly.',
                  style: TextStyle(
                    color: Colors.black,
                    fontWeight: FontWeight.w400,
                    fontSize: textSize_default.sp,
                    height: 1.5,
                  ),
                ),
                SizedBox(height: 20.h,),
                Image.asset('images/tips_9.png',width: screenWidth(context) - 40.w),
                SizedBox(height: 20.h,),
              ],
            ),
          ),
        )
    );
  }





}

